package com.sikaryofficial.backend.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author : qinjinyuan
 * @desc : 举报类型枚举
 * @date : 2023/11/04 10:08
 */
@Getter
@AllArgsConstructor
public enum BannerSectionPositionEnum {

    HOME_PAGE(1, "首页"),
    STATUTE(3,"法律法规"),
    CHANNEL_PROVIDER_PRODUCTS(4,"渠道商-商品-列表"),
    RULE_POINTS(5,"H5-首页-规则和积分入口")
   // ACTIVITY(2, "活动"),
    ;

    private final Integer code;
    private final String name;

    public static BannerSectionPositionEnum getEnum(Integer code) {
        return Arrays.stream(BannerSectionPositionEnum.values())
                .filter(pointRuleEnum -> Objects.nonNull(code) &&  pointRuleEnum.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
